#-*-encoding=utf-8-*-
steps = [
    FlowStep(
        name=u'init',
        title=u'Submit',
        fields=[u'project_id', u'description'],
        trigger=ur"""""",
        responsible=u'[request.principal.id]',
    actions=[
        FlowStepAction(
            nextsteps=[u'review'],
            trigger=ur"""##
p_id = sheet['project_id']
prj_data = parentcontainer['projects'][p_id]
prj_name = prj_data['project_name']
sheet['title'] = '删除项目-%s' % prj_name
##Send Notification
to_ids = []

#Send notify
general_manager = IFieldStorage(parentcontainer)['general_manager'][0]
to_ids.append(general_manager)

url = absoluteURL(sheet, request)
body = "Project delete request,for details please visit:%s" % (url)
msg_notifier.send('Project delete request', body, to_ids)
""",
            name=u'提交',
            condition=u'True',
            title=u'Submit'
)
])
,

    FlowStep(
        name=u'review',
        title=u'Review',
        fields=[],
        trigger=ur"""""",
        responsible=u"IFieldStorage(parentcontainer)['general_manager']",
    actions=[
        FlowStepAction(
            nextsteps=[],
            trigger=ur"""#Get sheet data
project_id = sheet['project_id']

#删除某个项目
del parentcontainer['projects'][project_id]

##Send Notification
to_ids = []

#Send to creator
creators = IDublinCore(sheet).creators
for uid in creators:
    to_ids.append(uid)

url = absoluteURL(sheet, request)
body = "Project delete request is approved,for details please visit:%s" % (url)
msg_notifier.send('Project delete request approved', body, to_ids)""",
            name=u'审核通过',
            condition=u'True',
            title=u'Approve'
),

        FlowStepAction(
            nextsteps=[],
            trigger=ur"""##Send Notification
to_ids = []

#Send to creator
creators = IDublinCore(sheet).creators
for uid in creators:
    to_ids.append(uid)

url = absoluteURL(sheet, request)
body = "Project delect request is rejected,for details please visit:%s" % (url)
msg_notifier.send('Project delete request rejected', body, to_ids)""",
            name=u'拒绝',
            condition=u'True',
            title=u'Refuse'
)
])
,

    FlowStep(
        name=u'833396',
        title=u'test',
        fields=[u'project_id'],
        responsible=u'request.principal.id',
    actions=[

])
]
